/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package disco;
import Dominio.GestorCliente;
import Dominio.GestorReserva;
import Dominio.GestorZona;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Serializable;

/**
 *
 * @author halt
 */
public class HandlerDisk implements Serializable{

    Disk hd;
    public HandlerDisk(){
        hd = new Disk();
    }

    public void guardarGestorReserva(GestorReserva gr) {
        hd.escribirEnDisco("reservas.fd", gr);
    }

    public GestorReserva cargarGestorReserva() throws FileNotFoundException, IOException, ClassNotFoundException {
        System.out.println("Estoy en el handlerDisk dentro de cargarGestorReserva");
        return (GestorReserva) hd.leerDeDisco("reservas.fd");
    }

    public void guardarGestorZona(GestorZona gz) {
        hd.escribirEnDisco("zonas.fd",gz);
    }

    public GestorZona cargarGestorZona() throws FileNotFoundException, IOException, ClassNotFoundException {
        return (GestorZona) hd.leerDeDisco("zonas.fd");
    }


    public void guardarGestorCliente(GestorCliente gc) {
        hd.escribirEnDisco("clientes.fd",gc);
    }

    public GestorCliente cargarGestorCliente() throws FileNotFoundException, IOException, ClassNotFoundException {
        return (GestorCliente) hd.leerDeDisco("clientes.fd");
    }
    /*utilizar serializable!*/

}
